﻿using Coldairarrow.Entity.Frontstage.Valickets;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

namespace Coldairarrow.Business.Frontstage.Valickets
{
    public interface IBS_UserVailTicketBusiness
    {
        Task<PageResult<BS_UserVailTicket>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<BS_UserVailTicket> GetTheDataAsync(string id);
        Task ChangeTicket(ChangeTInput input);
        Task<object> GetMyTicket(GetTicketInput input);
        Task AddDataAsync(BS_UserVailTicket data);
        Task UpdateDataAsync(BS_UserVailTicket data);
        Task DeleteDataAsync(List<string> ids);
    }

    public class UserVailTicketDTO
    { 
        public string Id { get; set; }

        public string TicketId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Ticket_Title { get; set; }

        /// <summary>
        /// 代金券类型(0,普通代金券，1.满减代金券)
        /// </summary>
        public int Ticket_Type { get; set; }

        /// <summary>
        /// 代金金额
        /// </summary>
        public decimal Ticket_Amount { get; set; }

        /// <summary>
        /// 代金金额
        /// </summary>
        public decimal? Ticket_UseMoney { get; set; }

        /// <summary>
        /// 背景图片
        /// </summary>
        public string Ticket_BackImg { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Note { get; set; }

        /// <summary>
        /// 使用说明
        /// </summary>
        public string Ticket_Abstract { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 兑换所需积分
        /// </summary>
        public Int32? Ticket_ChangePoint { get; set; }

        /// <summary>
        /// 使用状态(0.可使用,1.已使用,2.已过期)
        /// </summary>
        public Int32? UseState { get; set; }

        public DateTime? CreateTime { get; set; }
    }

    public class ChangeTInput { 
        [Required]
        public string TicketId { get; set; }

        public int? Count { get; set; } = 1;

    }

  
    public class GetTicketInput {
        public decimal? useMoney { set; get; }
        public int? State { set; get; }
    }
}